<?php
defined('IN_IA') or exit('Access Denied');
		global $_W, $_GPC;
		$sql = 'SELECT * FROM ' . tablename('uni_account_modules') . ' WHERE uniacid=:uniacid and module = :module';
		$setting = pdo_fetch($sql, array(':uniacid'=>$_W['uniacid'], ':module' => 'xuan_zyy'));
		$settings = iunserializer($setting['settings']);
		if ($_POST){
			$a = serialize($_POST);
			$user_data = array(
				'settings' => $a,
				'enabled'=>1
			);
			if (empty($setting)) {
				$user_data['uniacid']=$_W['uniacid'];
				$user_data['module']='xuan_zyy';
				$user_data['enabled']=1;
				$result = pdo_insert('uni_account_modules', $user_data);
			}else{
				$result = pdo_update('uni_account_modules', $user_data, array('uniacid'=>$_W['uniacid'],'module' => 'xuan_zyy'));
			}
			
			if (!empty($result)) {
				message('更新成功',$this->createWebUrl('set'));
			}
		}
		include $this->template('web/set');


